-
Notifications
You must be signed in to change notification settings - Fork 84
Restructure Unit/Property Model Imports; Eliminate Duplicate Prop Model Names #1693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Restructure Unit/Property Model Imports; Eliminate Duplicate Prop Model Names #1693
Conversation
| ====================== | ||
|
|
||
| .. index:: | ||
| pair: watertap.core.zero_order_properties;WaterParameterBlock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pair: watertap.core.zero_order_properties;ZOParameterBlock |
SHould this pair be updated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah docs are still a TO DO
|
|
||
| .. currentmodule:: watertap.core.zero_order_properties | ||
|
|
||
| The ideal water properties module contains a simple property package for saline waters which is intended for use with the WaterTap zero-order unit model library. The ideal water property package can be used in a flowsheet as shown below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The ideal water properties module (zero-order property model) contains a simple property package for saline waters which is intended for use with the WaterTap zero-order unit model library. The ideal water property package can be used in a flowsheet as shown below: |
Shouldn't we update the description a little bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes definitely. I would argue we should drop the "ideal properties" language entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc was re-written and moved.
| MCASParameterBlock, | ||
| ActivityCoefficientModel, | ||
| DensityCalculation, | ||
| MaterialFlowBasis, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big deal, but I noticed that in another file change, you switched to importing MaterialFlowBasis from idaes.core. That said, I prefer having MaterialFlowBasis importable from watertap.property_models too for convenience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree and I was going to do this but thought I would get pushback because it would require doing from idaes.core import MaterialFlowBasis in the init and I am not sure if that is a packaging no-no. But I can add it
|
|
||
| from watertap.core.wt_database import Database | ||
| import watertap.core.zero_order_properties as prop_ZO | ||
| import watertap.property_models.zero_order_properties as prop_ZO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note on consistency---in other files, you do import ZOParameterBlock--but not here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah haven't finished cleaning things up yet. I intend to be consistent across all files.
|
One issue I thought of with bringing this PR in during the Academy--if we'd like them to bring in any latest changes from main before the course concludes, they'd get whatever those targeted changes are, plus all of this, and I wonder if that'd throw them off (say, if imports start breaking. |
I am not sure what you mean here -- in theory if this was merged, imports wouldn't be breaking... Also the previous import structure still works fine. But either way yeah this PR really got away from me, if we want to hold off on it that is ok with me. I would be interested in what real developers think of a PR that modifies >300 files @sufikaur @ksbeattie @dangunter. I kept thinking "this could create a ton of merge conflicts for a ton of people" |
This can lead to merge conflicts, for one. Two, if you want to be absolutely sure nothing will break, then you should put up a PR on the academy repo that checks that no notebooks will fail when pointing to this PR. Maybe nothing breaks on the academy repo —but you cannot assure that simply because you have tests passing here. |
Here's an expected one to anticipate: |
Fixes/Resolves:
NA
Summary/Motivation:
Currently importing a property model requires also knowing the name of the actual file the parameter block lives in, which is often non-intuitive and cumbersome. Additionally, we have several property models that have the same named parameter block, which is also non-intuitive and cumbersome (and confusing). The same is true for unit models.
This PR modifies the init so you can:
from watertap.property_models import __________Or for unit models:
from watertap.unit_models import ________We also have a few property models that share a name:
NaClParameterBlockis shared by three property modelsWaterParameterBlockis shared by two property modelsThis PR also renames them to the following:
NaClParameterBlockfor crystallizer isCrystallizerParameterBlockNaClParameterBlockfor the temperature dependent property model isNaClTDepParameterBlockWaterParameterBlockfor the ZO property model is nowZOParameterBlockThis PR also cleaned up and improves the import structure in many unit files to follow
Imports are updated where necessary. Docs are updated where necessary.
Changes proposed in this PR:
zero_order_prop_packTO DO:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: